﻿Public Class Frm_Grilla
    Private Sub Frm_Grilla_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim col_width As Integer = 70
        Me.MdiParent = FrmPrincipal
        If DataGridView2.Rows.Count < 12 Then
            DataGridView2.Rows.Add(12)
        End If
        DataGridView2.RowHeadersWidth = 100
        For i = 0 To 11
            DataGridView2.Rows.Item(i).HeaderCell.Value = "Salon " & i + 1
        Next i
        For Each column As DataGridViewTextBoxColumn In DataGridView2.Columns
            column.Width = col_width
        Next
        DataGridView2.Width = DataGridView2.RowHeadersWidth + col_width * DataGridView2.Columns.Count + 2
        Me.Width = DataGridView2.Width + BtnPlanillasGuardar.Width + DataGridView2.Location.X + 20
        DataGridView2.Height = DataGridView2.Rows.Count * 25
        Me.Height = DataGridView2.Height + 20
    End Sub

    Private Sub CmbGrillaGrupo_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmbGrillaGrupo.SelectedIndexChanged
        If BtnGrillaCombinacion.Visible = False Then
            BtnGrillaCombinacion.Visible = True
        End If
        BtnGrillaCombinacion.Text = CmbGrillaGrupo.Text + Environment.NewLine + CmbGrillaAsignatura.Text
    End Sub
    Private Sub CmbGrillaAsignatura_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmbGrillaAsignatura.SelectedIndexChanged
        If BtnGrillaCombinacion.Visible = False Then
            BtnGrillaCombinacion.Visible = True
        End If

        BtnGrillaCombinacion.Text = CmbGrillaGrupo.Text + Environment.NewLine + CmbGrillaAsignatura.Text
    End Sub
End Class